<?php
/**
 * Created by PhpStorm.
 * User: zd
 * Date: 2019/4/17
 * Time: 14:43
 */

namespace app\api\model;


class MessageUser extends BaseModel
{
    protected $autoWriteTimestamp = true;

    /**
     * 添加聊天记录表
     * @param $data
     * @return $this
     */
    public static function addInfo($data){
        return self::create($data);
    }

    /**
     * 更新用户信息
     * @param $wu_id
     * @param $user_id
     * @param $type
     * @param $data
     * @return $this
     */
    public static function updateInfo($wu_id,$user_id,$type,$data){
        return self::where('wu_id','=',$wu_id)
                ->where('user_id','=',$user_id)
                ->where('type','=',$type)
                ->update($data);
    }

}